package cn.kcq.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * SaleOrderLine entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sale_order_line", catalog = "order")

public class SaleOrderLine implements java.io.Serializable {

	// Fields

	private Integer odlId;
	private SaleOrder saleOrder;
	private String odlProductName;
	private Float odlProductPrice;
	private Integer odlProductCount;

	// Constructors

	/** default constructor */
	public SaleOrderLine() {
	}

	/** full constructor */
	public SaleOrderLine(Integer odlId, SaleOrder saleOrder, String odlProductName, Float odlProductPrice,
			Integer odlProductCount) {
		this.odlId = odlId;
		this.saleOrder = saleOrder;
		this.odlProductName = odlProductName;
		this.odlProductPrice = odlProductPrice;
		this.odlProductCount = odlProductCount;
	}

	// Property accessors
	@Id
	@Column(name = "ODL_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getOdlId() {
		return this.odlId;
	}

	public void setOdlId(Integer odlId) {
		this.odlId = odlId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ODL_ORDER_ID", nullable = false)

	public SaleOrder getSaleOrder() {
		return this.saleOrder;
	}

	public void setSaleOrder(SaleOrder saleOrder) {
		this.saleOrder = saleOrder;
	}

	@Column(name = "ODL_PRODUCT_NAME", nullable = false, length = 50)

	public String getOdlProductName() {
		return this.odlProductName;
	}

	public void setOdlProductName(String odlProductName) {
		this.odlProductName = odlProductName;
	}

	@Column(name = "ODL_PRODUCT_PRICE", nullable = false, precision = 12, scale = 0)

	public Float getOdlProductPrice() {
		return this.odlProductPrice;
	}

	public void setOdlProductPrice(Float odlProductPrice) {
		this.odlProductPrice = odlProductPrice;
	}

	@Column(name = "ODL_PRODUCT_COUNT", nullable = false)

	public Integer getOdlProductCount() {
		return this.odlProductCount;
	}

	public void setOdlProductCount(Integer odlProductCount) {
		this.odlProductCount = odlProductCount;
	}

}